<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

defined('IN_ADMIN') or die('Hacking Attempt!');

func::isLogin();
mysql::begin(1);

$sTable = 'customer';

if(($_GET['id'] != '') && is_numeric($_GET['id'])){
    //get customerId
    $iCustomerId = $_GET['id'];
    
    $iIdDeleteCustomer = mysql::deleteSql($sTable, 'customerId', $iCustomerId);
    $iIdDeleteDebit = mysql::deleteSql ('debit', 'customerId', $iCustomerId);
    if($iIdDeleteCustomer && $iIdDeleteDebit){
        mysql::commit();
        func::redirect(func::makeUrl('customer', 'list'));
    }else
        mysql::rollBack();
}
?>
